翻訳と辞書
Words near each other
・ "O" Is for Outlaw
・ "O"-Jung.Ban.Hap.
・ "Ode-to-Napoleon" hexachord
・ "Oh Yeah!" Live
・ "Our Contemporary" regional art exhibition (Leningrad, 1975)
・ "P" Is for Peril
・ "Pimpernel" Smith
・ "Polish death camp" controversy
・ "Pro knigi" ("About books")
・ "Prosopa" Greek Television Awards
・ "Pussy Cats" Starring the Walkmen
・ "Q" Is for Quarry
・ "R" Is for Ricochet
・ "R" The King (2016 film)
・ "Rags" Ragland
・ ! (album)
・ ! (disambiguation)
・ !!
・ !!!
・ !!! (album)
・ !!Destroy-Oh-Boy!!
・ !Action Pact!
・ !Arriba! La Pachanga
・ !Hero
・ !Hero (album)
・ !Kung language
・ !Oka Tokat
・ !PAUS3
・ !T.O.O.H.!
・ !Women Art Revolution


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

special member functions : ウィキペディア英語版
special member functions

Special member functions in C++ are functions which the compiler will automatically generate if they are used, but not declared explicitly by the programmer.
The automatically generated special member functions are:
* Default constructor if no other constructor is explicitly declared
* Copy constructor if no move constructor and move assignment operator are explicitly declared.
: If a destructor is declared generation of a copy constructor is deprecated (C++11, proposal N3242 〔http://accu.org/index.php/journals/1896〕).
* Move constructor if no copy constructor, copy assignment operator, move assignment operator and destructor are explicitly declared.
* Copy assignment operator if no move constructor and move assignment operator are explicitly declared.
: If a destructor is declared generation of a copy assignment operator is deprecated.
* Move assignment operator if no copy constructor, copy assignment operator, move constructor and destructor are explicitly declared.
* Destructor
In these cases the compiler generated versions of these functions perform a ''memberwise'' operation. For example the compiler generated destructor will destroy each sub-object (base class or member) of the object.
The compiler generated functions will be public, non-virtual〔Except for the destructor if a base class already has a virtual destructor.〕 and the copy constructor and assignment operators will receive const& parameters (and not be of the alternative legal forms).
==Example==
The following example depicts two classes: Explicit for which all C++98 special member functions are explicitly declared and Implicit for which none are declared.

#include
class Explicit
Explicit(const Explicit& other) : msg(other.msg)

Explicit& operator=(const Explicit& other)


~Explicit()

};
class Implicit : public Explicit ;


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「special member functions」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.